package com.example.weisdk;

import com.example.weisdk.client.Client;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
//能够读取.yml文件配置，读取到配置后设置到我们这里的属性中，
//给所有的配置加上前缀 wei-client
@ConfigurationProperties("wei.client")
@Data
@ComponentScan
public class ClientConfig {
    private String accessKey;
    private String secretKey;
    @Bean
    public Client WEIClient(){

        return new Client(accessKey,secretKey);
    }
}
